#include <bits/stdc++.h>
using namespace std;
#define int long long
void solve()
{
    int n;
    cin>>n;
    int ans=1;
    set<int>s;
    while(n--)
    {
        int l,r;
        cin>>l>>r;
        bool f=0;
        auto it=s.lower_bound(l);
        if(it!=s.end()&&*it<=r)cout<<ans<<endl;
        else 
        {
            ans=max(ans,(r-l+1)+1);
            cout<<ans<<endl;
            s.insert(l),s.insert(r);
        }
    }
}
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int T=1;
    //cin>>T;
    while(T--)
    {
       solve();
    }
    return 0;
}